<%@ page import="com.crr.entity.User" %><%--
  Created by IntelliJ IDEA.
  User: acer
  Date: 2024-7-26
  Time: 16:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%--<%--%>
<%--    String username=null;--%>
<%--    Cookie[] cookies=request.getCookies();--%>
<%--    if(cookies!=null){--%>
<%--        for(int i=0;i<cookies.length;i++){--%>
<%--            if(cookies[i].getName().equals("name"))--%>
<%--        username=cookies[i].getValue();--%>
<%--        }--%>
<%--    }--%>
<%--%>--%>
<%--你好，<%=username%>--%>
<%
    User user=(User) request.getSession().getAttribute("u");
    if(user==null){
        response.sendRedirect("login.html");
    }
%>
<form method="post">
    <h1> 你好，${u.userName}</h1> <a href="/loginOut" methods="post">安全退出</a>
</form>


</body>
</html>
